let app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    var car_id = options.car_id;
  //  
    this.setData({
      platform:app.globalData.platform,
      width:app.globalData.windowWidth,
      height:app.globalData.windowHeight,
      statusBarHeight:app.globalData.statusBarHeight,
      navHeight:app.globalData.navHeight,
      marginTop:app.globalData.navTitleTop,
      domain:app.globalData.domain
    })
  },
  goBack(){
    wx.navigateBack();
  },
  showModals:function(msg,url,index){
    wx.showModal({
        title: '系统提示',
        content:msg,
        success:function(res){
          console.log(res)
           if(res.confirm){
            if(url){
              if(index == 'index'){
                wx.reLaunch({
                  url: url,
                })
              }else{
                wx.navigateTo({
                  url: url,
                })
              }
            }
           }
           if(res.cancel){

           }
        }
    })
},
goto:function(e){
    console.log(e);
    var url=e.currentTarget.dataset.url;
    var index=e.currentTarget.dataset.index;
    var parent_id=wx.getStorageSync('parent_id');
    if(url=="#"){

    }else if(index=='index'){
        wx.reLaunch({
          url: url,
        })
    }else{
        wx.navigateTo({
          url: url,
        })
    }
    console.log(url);
},
  getWashLog(){
  let that = this;
  var open = wx.getStorageSync('open');
  wx.request({
    url: app.globalData.domain+'wechat/wash/getWashLog',
    data:{'from':"3",open_id:open.id},
   success:res => {
     console.log(res)   
     let data = res.data;  
    
     this.setData({
       order:data.order,
       //car:data.car,
       count:data.count     
     })
     
   }
 })
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    this.getWashLog();
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})